package com.yunfeisoft.business.dao.impl.postgres;

import com.applet.base.ServiceDaoImpl;
import com.applet.sql.builder.WhereBuilder;
import com.applet.utils.Page;
import com.yunfeisoft.business.dao.inter.CmsSubjectCategoryDao;
import com.yunfeisoft.business.model.CmsSubjectCategory;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * ClassName: CmsSubjectCategoryDaoImpl
 * Description: 专题分类表Dao实现
 * Author: Jackie liu
 * Date: 2020-06-02
 */
@Repository
public class CmsSubjectCategoryDaoImpl extends ServiceDaoImpl<CmsSubjectCategory, String> implements CmsSubjectCategoryDao {

    @Override
    public Page<CmsSubjectCategory> queryPage(Map<String, Object> params) {
        WhereBuilder wb = new WhereBuilder();
        if (params != null) {
            initPageParam(wb, params);
            wb.andFullLike("name", params.get("name"));
        }
        return queryPage(wb);
    }

    @Override
    public List<CmsSubjectCategory> queryList(Map<String, Object> params) {
        WhereBuilder wb = new WhereBuilder();
        if (params != null) {
            wb.andFullLike("name", params.get("name"));
        }
        return query(wb);
    }
}